home *** CD-ROM | disk | FTP | other *** search
/ Champak 43 / Vol 43.iso / games / superdog.swf / scripts / DefineSprite_1506 / frame_2 / DoAction.as
Encoding:
Text File  |  2007-06-25  |  995 b   |  43 lines

  1. stop();
  2. onEnterFrame = function()
  3. {
  4.    if(_parent._parent.pauses == false)
  5.    {
  6.       if(this._y >= 600)
  7.       {
  8.          this.removeMovieClip();
  9.       }
  10.       this._x += 4;
  11.       if(inAir)
  12.       {
  13.          if(yinc < 10)
  14.          {
  15.             yinc += g;
  16.          }
  17.          this._y += yinc;
  18.          var _loc3_ = 0;
  19.          while(_loc3_ < _parent._parent.land_array.length)
  20.          {
  21.             landObject = _parent[_parent._parent.land_array[_loc3_]];
  22.             var _loc4_ = landObject.getBounds(_parent).yMin;
  23.             if(this.dfk.hitTest(landObject))
  24.             {
  25.                if(this._y - yinc < _loc4_)
  26.                {
  27.                   inAir = false;
  28.                   this._y = _loc4_;
  29.                   yinc = 0;
  30.                   break;
  31.                }
  32.             }
  33.             _loc3_ = _loc3_ + 1;
  34.          }
  35.       }
  36.       else if(!this.dfk.hitTest(landObject))
  37.       {
  38.          yinc = 1;
  39.          inAir = true;
  40.       }
  41.    }
  42. };
  43.